Wait Until

Entity And Resource-Related Operation Statement

Syntax samples

WAIT UNTIL <Boolean expression>

WAIT UNTIL Var1 > 3

WAIT UNTIL Var1 < Attr3 AND Var2 >= 5

Description

Delays processing of the current logic until the Boolean expression is true. The rest of the model continues to process during the delay. Note that if the expression is initially evaluated to be false, it is only reevaluated when a location attribute, variable, or array element in the expression changes. Multiple entities waiting on the same condition are released one at a time. This allows a released entity to change a variable value that will prevent the other waiting entities from being released.

Valid In

Node entry and node exit logic delays processing for resources, and location processing logic delays processing for entities. Independent Subroutines. (See Subroutines.)

Components

<Boolean expression>

The condition that must be satisfied to continue processing the entity or resource. Elements of this expression are limited to location attributes, variables, and array elements.

Example

The example below uses the WAIT UNTIL statement to group a variable quantity of entities. As each EntA arrives at Loc1, a variable (Total) is incremented to keep track of the total entities waiting at the location. The WAIT UNTIL statement causes processing of all EntA’s to halt at this point until the variable, Var1, reaches or exceeds 500. Then all of the waiting EntA’s are GROUPed together as a BatchA.

Process Table

Entity

Location

Operation (min)

EntA

Loc1

INC Total

WAIT UNTIL Total >= 5

GROUP Total AS Batch

Routing Table

Blk

Output

Destination

Rule

Move Logic

 

 

 

 

 

See Also

DO...WHILE, WHILE...DO, and DO...UNTIL.